const mongoose=require('mongoose');

function dbConnect() {
    mongoose.connect('mongodb://localhost:27017/slides');
    mongoose.connection.once('open',function (err) {
        if(!err){
            console.log('数据库已连接...!');
        }else {
            console.log('数据库连接失败...!');
        }
    });
}

exports.dbConnect=dbConnect;